# "Foreign Aid and State Legitimacy: Evidence on Chinese and US Aid to Africa from Surveys, Survey Experiments, and Behavioral Games"
# Robert A. Blair and Philip Roessler
# World Politics
# Replication Files

# Mater R Script 

# Filepaths --------------------------------------------------------------------
project_file_path <- "[YOUR DIRECTORY]" 

code_file_path <- file.path(project_file_path, "Code")
data_file_path <- file.path(project_file_path, "Data")
outputs_file_path <- file.path(project_file_path, "Outputs")
tables_file_path <- file.path(outputs_file_path, "tables")

# Parameters -------------------------------------------------------------------
# Define parameters that are used in multiple scripts

# Vector of iso codes for countries where have both US and Chinese aid data and
# Afrobarometer data
iso_usaid <- c("MWI","NIG","UGA","SEN","BDI","SRL")

# Packages ---------------------------------------------------------------------
library(dplyr)
library(stargazer)
library(lfe)
library(car)

# User defined functions
source(file.path(code_file_path, "make_reg_table_functions.R"))

# Run Scripts ------------------------------------------------------------------
source(file.path(code_file_path, "table_a10.R"))
source(file.path(code_file_path, "table_a11.R"))
source(file.path(code_file_path, "table_a12.R"))
source(file.path(code_file_path, "table_a13.R"))
source(file.path(code_file_path, "table_a14.R"))
source(file.path(code_file_path, "table_3_a15-a20.R"))
